﻿//********************************************************************************//
//创建日期：<创建日期，2016-04-07>
//创建作者：<郭登杰，guodengjie@shanghai3h.com>
//功能说明：本月托收汇总
//********************************************************************************//
using System;
using BLL.Access;
using System.Data;

namespace Web.Pages.YongShui
{
    public partial class BenYueTSHZ : BasePage
    {
        #region 属性

        /// <summary>
        /// 记录查询结果集
        /// </summary>
        private DataTable dtSource
        {
            get
            {
                return ViewState["dtSource"] as DataTable;
            }
            set
            {
                ViewState["dtSource"] = value;
            }
        }

        #endregion

        #region 变量

        /// <summary>
        /// 数据访问操作类
        /// </summary>
        SpHelper _spHelper = new SpHelper();

        #endregion

        #region 事件

        /// <summary>
        /// 页面加载事件
        /// </summary>
        protected void Page_Load(object sender, EventArgs e)
        {            
            //第一次页面加载
            if (!IsPostBack)
            {
                LoadData();
            }
            this.gvList1.DataSource = this.dtSource;
            this.gvList1.DataBind();
        }

        #endregion

        #region 方法

        /// <summary>
        /// 查询数据
        /// </summary>
        private void LoadData()
        {
            int ym = int.Parse(this.Request["ym"]);
            this.dtSource = _spHelper.P_YSSF_GETTUOSHOUHZ(ym / 100, ym % 100).Tables[0];
            this.gvList1.DataSource = this.dtSource;
            this.gvList1.DataBind();
        }

        #endregion

        protected void btnExport_Click(object sender, EventArgs e)
        {
            this.ASPxGridViewExporter1.GridViewID = "gvList1";
            this.gvList1.DataSource = this.dtSource;
            this.gvList1.DataBind();
            string sName = "汇总信息";
            ASPxGridViewExporter1.WriteXlsToResponse(sName);
        }
    }
}